package Model.Cages;

import Model.Animals.Animal;
import Model.Animals.Behaviours.FlyWithWings;

/**
 *
 * @author HOANG TRUONG DINH
 */
public class CageAir extends Cage {

    public CageAir(int capacity, String ref, int x, int y) {
        super(capacity, ref, x, y);
        cost = 6000;
    }

    @Override
    public void run() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean addAnimal(Animal a) {
        if (animals.contains(a)) {
            System.out.println("This animal is added.");
            return false;
        }
        if (!(a.getFlyable() instanceof FlyWithWings)) {
            return false;
        } else {
            this.animals.add(a);
        }
        return true;
    }
}
